import jdk.internal.org.objectweb.asm.tree.MultiANewArrayInsnNode;

import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Jiang Jinxi
 * Date: 2024-03-26
 * Time: 20:29
 */
public class test {
    public static void main(String[] args) {
        Set<String> set = new TreeSet<>();
        set.add("hello");
        set.add("abc");
        set.add("poll");
        System.out.println(set);
    }
    public static void main2(String[] args) {
        Map<String,Integer> map = new TreeMap<>();
        map.put("abc",3);
        map.put("hello",3);
        map.put("poll",3);
        System.out.println(map);
        int val = map.get("abc");
        Set<String> key = map.keySet();
        System.out.println(key);
        Set<Map.Entry<String,Integer>> set = map.entrySet();
        for (Map.Entry<String,Integer> entry:
             set) {
            System.out.println("key: "+ entry.getKey()+" val: " + entry.getValue());

        }


    }
    public static void main1(String[] args) {
        BinarySearchTree bTree = new BinarySearchTree();
        bTree.insert(10);
        bTree.insert(6);
        bTree.insert(15);
        bTree.insert(12);
        bTree.insert(11);
        bTree.insert(20);
        bTree.insert(14);
        bTree.insert(25);
        System.out.println();
        System.out.println(bTree.search(20));
        bTree.remove(15);
    }
}
